Link between DOORS and OLE Object?

Is it possible to create a link from DOORS Object to OLE Object in any Ms Office Application?I want to open the corresponding ole Object(any excel sheet cell,access table row or project task) using that link.
MF2G_qaus_qazah - Mon Jun 25 06:49:14 EDT 2012

Re: Link between DOORS and OLE Object?
Mathias Mamsch - Wed Jun 27 06:27:32 EDT 2012

Well if you can find an URL that will open the OLE object (I doubt that this is possible), you can use an External Link for that. You are not talking about Embedded vs. Linked OLE objects, are you? Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Link between DOORS and OLE Object?
MF2G_qaus_qazah - Wed Jun 27 06:34:02 EDT 2012

I am talking about the ole Automation Object (OleAutoObj).

Re: Link between DOORS and OLE Object?
OurGuest - Wed Jun 27 07:01:06 EDT 2012

MF2G_qaus_qazah - Wed Jun 27 06:34:02 EDT 2012
I am talking about the ole Automation Object (OleAutoObj).

If you can feed your dxl enough info and the office document is available you dxl can open the document and go to the location you desire in ms-word and excel.

Re: Link between DOORS and OLE Object?
MF2G_qaus_qazah - Thu Jun 28 23:53:52 EDT 2012

Here is my code

pragma runLim,0
 
//--------------                        Global Declarations                     ------------------------//
DB dbDialog=create "Update from Access"
DBE dbeFilePath, dbeTable, dbeFieldName,dbeAttribute,dbeQuery
DBE dbeID
string attrNames[50]
int noOfAttrs=0
string an
string radioChoices[]={"Get","Set"}
 
//-----------------------                       build dialog            ----------------------------//
DB buildDialog()
{
for an in attributes(current Module) do
        {
                attrNames[noOfAttrs]=an
                //print "attrNames : " attrNames[noOfAttrs] "\tIndex : " noOfAttrs "\n"
                noOfAttrs++
        }
        attrNames[noOfAttrs]="Object Text"
        noOfAttrs++
        attrNames[noOfAttrs]="Object Heading"
        noOfAttrs++
                dbeAttribute = choice(dbDialog, "Attribute: ", attrNames,noOfAttrs,0)
                dbeFilePath=fileName (dbDialog,"Select File :","D:\\Sidrah\\PAKTES-1 Schedule")
                
return dbDialog
}
 
//----------------              Get Project Application Reference               -----------------//
OleAutoObj GetAppObj()
{
        OleAutoObj      oleProjectApp   =       null
                        
        oleProjectApp=oleGetAutoObject("MSProject.Applicaion")
        if(null oleProjectApp)
        {
                oleProjectApp = oleCreateAutoObject("MSProject.Application")
                if (null oleProjectApp)
                {
                        errorBox("Unable to open Project application")
                }
        }
        return oleProjectApp
}
 
//-------------------           Get Ms Project Object Reference         ------------------//
OleAutoObj GetProject(OleAutoObj olePrjApp, string sFileName)
{
        OleAutoObj      oleProjects     =       null
        OleAutoObj      oleProject      =       null
        OleAutoArgs     autoArgs        =       create
        string          sProjectName=   ""
        string          sAuthor         =       ""
        
        put(autoArgs,sFileName)
        oleMethod(olePrjApp,"FileOpenEx",autoArgs)
        oleGet(olePrjApp,"Projects",autoArgs,oleProject)
        if(null oleProject)
                print "oleProject is null\n"
        oleGet(oleProject,"Name",sProjectName)
        print "Project Name : " sProjectName "\n"
        oleGet(oleProject,"Author",sAuthor)
        print "Project Author : " sAuthor "\n"
        return oleProject
}
 
//-----------------             Get Task Reference              -----------------//
OleAutoObj GetTask(OleAutoObj oleProject, string wbs)
{
        OleAutoObj      oleTasks        =       null
        OleAutoObj      oleTask         =       null
        OleAutoArgs     autoArgs        =       create
        int                     taskCount       =       0
        int                     i                       =       0
        string          taskName        =       ""
        string          taskWBS         =       ""
        
        oleGet(oleProject,"Tasks",oleTasks)
        oleGet(oleTasks,"Count",taskCount)
        print "Tasks Count : " taskCount "\n"
        print "Object WBS : " wbs "\n"
        for(i=1;i<=taskCount;i++)
        {
                put(autoArgs,i)
                oleGet(oleTasks,"Item",autoArgs,oleTask)
                oleGet(oleTask,"Name",taskName)
                oleGet(oleTask,"WBS",taskWBS)
                if(taskWBS == wbs)
                {
                        print "Task Name : " taskName "\nTask WBS : " taskWBS "\n"
                        clear autoArgs
                        return oleTask
                }
                clear autoArgs
        }
}
 
//-------------------           close Project Application               -----------------//
void projectQuit(OleAutoObj oleProject)
{
        oleMethod(oleProject,"Quit")
        oleCloseAutoObject(oleProject)
}
 
//-----------   link the current object to Ms Project Task                      ------------//
void linkMsProjectTask(DB dbDialog)
{
        int x = 0
        int y = 0
        string sFilePath = get dbeFilePath
        Object o = current
        string wbs = o."WBS"
        
        OleAutoObj      olePrjApp       =       GetAppObj()
        OleAutoObj      oleProject      =       GetProject(olePrjApp,sFilePath) 
        OleAutoObj      oleTask         =       GetTask(oleProject,wbs)
 
/*===  Want to create the link from Object "o"(Source) and OLE Object "oleTask"(Target) ===*/
        
        projectQuit(olePrjApp)
        refresh current Module
}
 
//---------------               call this function when OK button pressed       ------------//
void callOK(DB dbDialog)
{
        linkMsProjectTask(dbDialog)
}
 
//-----------------                     MAIN                    -------------------------//
 
dbDialog=buildDialog()
        ok(dbDialog,"OK", callOK)
        realize dbDialog 
        show dbDialog

 


I have mentioned the objects in linkMsProjectTask() for which I have to create link.

Please tell me Does there exists any possibility to do this???

 

Re: Link between DOORS and OLE Object?
Mathias Mamsch - Fri Jun 29 17:50:27 EDT 2012

MF2G_qaus_qazah - Thu Jun 28 23:53:52 EDT 2012

Here is my code

pragma runLim,0
 
//--------------                        Global Declarations                     ------------------------//
DB dbDialog=create "Update from Access"
DBE dbeFilePath, dbeTable, dbeFieldName,dbeAttribute,dbeQuery
DBE dbeID
string attrNames[50]
int noOfAttrs=0
string an
string radioChoices[]={"Get","Set"}
 
//-----------------------                       build dialog            ----------------------------//
DB buildDialog()
{
for an in attributes(current Module) do
        {
                attrNames[noOfAttrs]=an
                //print "attrNames : " attrNames[noOfAttrs] "\tIndex : " noOfAttrs "\n"
                noOfAttrs++
        }
        attrNames[noOfAttrs]="Object Text"
        noOfAttrs++
        attrNames[noOfAttrs]="Object Heading"
        noOfAttrs++
                dbeAttribute = choice(dbDialog, "Attribute: ", attrNames,noOfAttrs,0)
                dbeFilePath=fileName (dbDialog,"Select File :","D:\\Sidrah\\PAKTES-1 Schedule")
                
return dbDialog
}
 
//----------------              Get Project Application Reference               -----------------//
OleAutoObj GetAppObj()
{
        OleAutoObj      oleProjectApp   =       null
                        
        oleProjectApp=oleGetAutoObject("MSProject.Applicaion")
        if(null oleProjectApp)
        {
                oleProjectApp = oleCreateAutoObject("MSProject.Application")
                if (null oleProjectApp)
                {
                        errorBox("Unable to open Project application")
                }
        }
        return oleProjectApp
}
 
//-------------------           Get Ms Project Object Reference         ------------------//
OleAutoObj GetProject(OleAutoObj olePrjApp, string sFileName)
{
        OleAutoObj      oleProjects     =       null
        OleAutoObj      oleProject      =       null
        OleAutoArgs     autoArgs        =       create
        string          sProjectName=   ""
        string          sAuthor         =       ""
        
        put(autoArgs,sFileName)
        oleMethod(olePrjApp,"FileOpenEx",autoArgs)
        oleGet(olePrjApp,"Projects",autoArgs,oleProject)
        if(null oleProject)
                print "oleProject is null\n"
        oleGet(oleProject,"Name",sProjectName)
        print "Project Name : " sProjectName "\n"
        oleGet(oleProject,"Author",sAuthor)
        print "Project Author : " sAuthor "\n"
        return oleProject
}
 
//-----------------             Get Task Reference              -----------------//
OleAutoObj GetTask(OleAutoObj oleProject, string wbs)
{
        OleAutoObj      oleTasks        =       null
        OleAutoObj      oleTask         =       null
        OleAutoArgs     autoArgs        =       create
        int                     taskCount       =       0
        int                     i                       =       0
        string          taskName        =       ""
        string          taskWBS         =       ""
        
        oleGet(oleProject,"Tasks",oleTasks)
        oleGet(oleTasks,"Count",taskCount)
        print "Tasks Count : " taskCount "\n"
        print "Object WBS : " wbs "\n"
        for(i=1;i<=taskCount;i++)
        {
                put(autoArgs,i)
                oleGet(oleTasks,"Item",autoArgs,oleTask)
                oleGet(oleTask,"Name",taskName)
                oleGet(oleTask,"WBS",taskWBS)
                if(taskWBS == wbs)
                {
                        print "Task Name : " taskName "\nTask WBS : " taskWBS "\n"
                        clear autoArgs
                        return oleTask
                }
                clear autoArgs
        }
}
 
//-------------------           close Project Application               -----------------//
void projectQuit(OleAutoObj oleProject)
{
        oleMethod(oleProject,"Quit")
        oleCloseAutoObject(oleProject)
}
 
//-----------   link the current object to Ms Project Task                      ------------//
void linkMsProjectTask(DB dbDialog)
{
        int x = 0
        int y = 0
        string sFilePath = get dbeFilePath
        Object o = current
        string wbs = o."WBS"
        
        OleAutoObj      olePrjApp       =       GetAppObj()
        OleAutoObj      oleProject      =       GetProject(olePrjApp,sFilePath) 
        OleAutoObj      oleTask         =       GetTask(oleProject,wbs)
 
/*===  Want to create the link from Object "o"(Source) and OLE Object "oleTask"(Target) ===*/
        
        projectQuit(olePrjApp)
        refresh current Module
}
 
//---------------               call this function when OK button pressed       ------------//
void callOK(DB dbDialog)
{
        linkMsProjectTask(dbDialog)
}
 
//-----------------                     MAIN                    -------------------------//
 
dbDialog=buildDialog()
        ok(dbDialog,"OK", callOK)
        realize dbDialog 
        show dbDialog

 


I have mentioned the objects in linkMsProjectTask() for which I have to create link.

Please tell me Does there exists any possibility to do this???

 

No, you cannot make an embedded OLE object from any OleAutoObj. The COM server application (in your case MS Project) defines, which Objects you can embed. I am pretty sure a single task in MS Project is not embeddable. But you could save the ID of the task in an attribute and use DXL to get the task using the OleAutoObj and the ID. Maybe that helps, regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS